<!DOCTYPE HTML>
<html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>{{ config('website_name') }} | @yield('title')</title>
    <meta name="keywords" content="{{ config('website_keywords') }}" />
    <meta name="description" content="{{ config('website_description') }}" />
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <link href="{{ asset('css/bootstrap.min.css')}}" rel="stylesheet">
    <link href="{{ asset('css/style.css')}}" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="{{ asset('css/magnific-popup.css') }}">
    @yield('csses')
  </head>
  <body>
    @include('sections.header')
    <div id="main"  class="container" >
      @yield('content')
    </div>


    @include('sections.footer')
    <div class="copy">
      Copyright © 2016  Editorial Office of ZOOLOGICAL RESEARCH
      {!! config('statistic_code') !!}
    </div>

    <script src="{{ asset("js/jquery.min.js") }}"></script>
    <script src="{{ asset("js/bootstrap.min.js") }}"></script>
    <script src="{{ asset("js/jquery.magnific-popup.js") }}"></script>
    @yield('scripts')
    <script type="text/javascript">
    $(document).ready(function() {
      $('.image-popup-vertical-fit').magnificPopup({
        type: 'image',
        closeOnContentClick: true,
        mainClass: 'mfp-img-mobile',
        image: {
          verticalFit: true
        }
      });



      if ($('#main-check').length > 0) {
        $('#main-check').click(function(e) {
          if ($(this).is(':checked')) {
            $('.article_check').prop('checked', 'checked');
          } else {
            $('.article_check').prop('checked', false)
          }
        })
      }

      $("#ref-export").hover(function() {
        $(this).find('dl').show();
      }, function() {
        $(this).find('dl').hide();
      });


      $('#ref-export').on('click', 'a', function(e) {
        e.preventDefault();
        var ids = [];
        $('.article_check:checked').each(function() {
          ids.push($(this).val());
        });

        if (ids.length == 0) {
          alert("请先选择文章");
          return ;
        }
        var type = $(this).data('type');
        var url = $('#ref-export').data('e-url');

        window.location.href= url + '?ids=' + ids + '&type=' + type;

        // $.ajax({
        //   url: url,
        //   method: 'GET',
        //   data: {
        //     ids: ids,
        //     type: type
        //   }, 
        //   success: function() {

        //   }
        // });
      });

    });
    </script>
  </body>
</html>